package com.fengjue.userservice.feignclient;

import com.fengjue.userservice.entity.Product;
import com.fengjue.userservice.failback.ProductClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "productservice",fallbackFactory = ProductClientFallBack.class)
public interface ProductClient {


    @GetMapping("/product/showMsg")
    String showMsg();


    @GetMapping("/product/findOne")
    public Map<String,Object> findOne(@RequestParam("productId") String productId);

    @PostMapping("/product/update")
    public Map<String,Object> update(@RequestBody Product product);
}
